const fs = require('fs-extra')
const path = require('path')
const chalk = require('chalk')

const templates = [
  'admin-templates',
  'data-visualization-templates'
]

const copies = [
  '.editorconfig',
  'LICENSE'
]

templates.forEach(templateDir => {
  fs.readdirSync(templateDir)
    .map(fileName => path.join(templateDir, fileName))
    .filter(fileName => !fs.lstatSync(fileName).isFile())
    .forEach(folder => {
      copies.forEach(fileName => {
        fs.copySync(fileName, path.join(folder, fileName))
      })
    })
})

console.log(chalk.green('\nOkay !\n'))
